Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Graphics /
Chapter 6 - Picture Shapes / About Picture Shapes


Transform Concatenation

Each item in a picture shape has its own transform object and possibly an overriding transform as well. When QuickDraw GX draws a picture shape, it maps and clips each item according the mapping and clipping information stored in that item's transform object (or the information in the item's overriding transform, if it has one). After applying mappings and clippings to the individual items of a picture, QuickDraw GX applies a mapping and clipping to the entire picture, as indicated by the transform object associated with the picture shape. In this way, each item in the picture can go through two transformations: an individual transformation as indicated by the item's individual transform (or overriding transform), and a group transformation as indicated by the picture shape's transform. This process is called transform concatenation.

If a picture shape contains a picture hierarchy, QuickDraw GX repeats this concatenation process from the individual shapes at the lowest level of the hierarchy all the way up to the picture shape at the highest level of the hierarchy.

As an example, Figure 6-14 shows a path shape representing a house. This path shape has a transform that rotates it 180 degrees.

Figure 6-14 A path shape and its transform

Figure 6-15 shows the same path shape, but in this figure the path shape has been added to a picture shape as the picture's only item. This item includes an overriding transform. When drawing this picture, QuickDraw GX ignores the original transform, and rotates every item in the path shape clockwise by 90 degrees, as specified in the overriding transform.

Figure 6-15 A picture with an overriding transform

Figure 6-16 shows the same picture shape as Figure 6-15. In Figure 6-16, however, the picture shape at the top of the picture hierarchy has its own transform object that specifies that the entire picture should be rotated counterclockwise by 90 degrees. QuickDraw GX concatentates the overriding transform of the path shape (labeled 1 in the picture) with the transform of the top of the picture hierarchy (labeled 2 in the picture), and draws the house at its original orientation. The original transform of the path shape (labeled 1A) is ignored because of the overriding transform.

Figure 6-16 Simple transform concatenation

Figure 6-17 shows an even more complex example of transform concatenation. This figure shows the same picture from Figure 6-16, but in Figure 6-17 this picture has been added as an item to another picture.

To draw this picture, QuickDraw GX uses the overriding transform (labeled 1) of the original path shape, which rotates it 90 degrees to the right. Then QuickDraw GX uses the overriding transform (labeled 2) associated with the picture that contains the path shape, which scales the picture by a factor of 2. Finally, QuickDraw GX uses the transform object (labeled 3) of the picture at the top of the hierarcy, which rotates the picture 45 degrees to the right. The result is shown at the bottom of Figure 6-17.

Figure 6-17 Intricate transform concatenation

You can find more examples of transform concatentation in "Creating Picture Hierarchies" beginning on page 6-44.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help